from django.shortcuts import render
from django.http import JsonResponse
from knowledge.utils.fetchWebsite import fetchData

def goKnowledgePage(request):
	if request.method == 'POST':
	    pass
	return render(request,'knowledge.html')

def fetchInfo(request,website='wiki',languagetype='zh'):
    data = {'content': ''}
    if request.method == "POST":
        inputData = request.POST
        data["content"] = fetchData(inputData['somewhat'],website=website,languagetype=languagetype)
    return JsonResponse(data)